#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char buf[100] = "";

void showStyle()
{
    system("title 语音朗读");
    system("mode con cols=80 lines=30");
    system("color f0");
 }

void inputInfo()
{
    memset(buf,0,100);
    printf("输入要朗诵的文字： \n");
    gets(buf);
}

int main()
{
    showStyle();
    while(1)
    {
        FILE *fq=fopen("voice.vbs","w");
        inputInfo();
        if(fq!=NULL)
        {
            fprintf(fq,"CreateObject(\"SAPI.Spvoice\").Speak\"%s\"",buf);
            fclose(fq);
            system("voice.vbs");
            system("del voice.vbs");
        }
        printf("朗诵文为:%s\n",buf);
        fclose(fq);
    }
    system("pause");
    return 0;
}
